<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<link href="./css/modern.css" rel="stylesheet"> 
<link href="./css/style-student-group.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<script>
function ViewValidation()
{
	var radios = document.getElementsByName('courseNumber');
	for(var i =0; i< radios.length; i++)
	{
		if(radios[i].checked){
			return true;
		}
	}
	
	alert("Please Select a COGS!");
	return false;
}
</script>
<%@ page import="java.util.ArrayList" %>
<%
	String firstname = (String) request.getAttribute("firstname");
	String lastname = (String) request.getAttribute("lastname");
	String courseNumber = (String) request.getAttribute("courseNumber");
	String sectionNumber = (String) request.getAttribute("sectionNumber");
	ArrayList<Integer> numOfTAsNeeded = (ArrayList<Integer>) request.getAttribute("numOfTAsNeeded");
%>
<body>
<div id="container">
	<div id="header"><br>
		<h1 id="main-title"><b><font color = "000000">EECE Student Group Assessments</b></font></h1>
		<h2>
			Please select a COGS Session to assign duties to Teaching Assistants.
			<a href="index.html">
			<p align="right"><font size = "5">Logout</font></p>
			</a>
		</h2>		
	</div>
    <div id="body" class="page-region-content tiles">
                <form id=form method="post" action="ProfBackCoursePortalServlet" >
             	<a href = "javascript:;" onclick="document.getElementById('form').submit();" class="back-button big page-back">
             		<input type = "hidden" name = "firstname" value = <%=firstname%>>
					<input type = "hidden" name = "lastname" value = <%=lastname%>>	
					<input type = "hidden" name = "courseNumber" value = "<%=courseNumber%>">
					<input type = "hidden" name = "sectionNumber" value = <%=sectionNumber%>>	
             	</a>
            </form>
    		<div id="innerBody" class="page-region-content tiles">
		<h1><%=courseNumber%> COGS List Section <%=sectionNumber%></h1><br>

<form action="ProfTADutyBallotServlet" id="myform" method="get">		
	<table cellspacing="0" cellpadding="0" border="0" width="325" class="striped" border=1>
  <tr>
    <td>
       <table cellspacing="0" cellpadding="1" border="0" width="300"class="striped" border=1 >
         <tr>
            <th>Cognitive Group Session List</th>
         </tr>
       </table>
    </td>
  </tr>
  <tr>
    <td>
       <div style="100%; height:250px; width: 1000px; overflow:auto;">
         <table class="fixed" cellspacing="0" cellpadding="1" border="0" width="300" class="striped" border=1>
           <tr>
           		<td><b></b></td>
          	    <td><b>COGS Name</b></td>
          	     <td><b>Group Division</b></td>
				<td><b>Start Time</b></td>
				<td><b>End Time</b></td>
				<td><b>Number of TAs required</b></td>
           </tr>
           <%int i=0; %>
           <c:forEach items="${COGSInfo}" var="Info">
          
           <tr>
           		<td><label class="radio" onclick=""> 
					<input type="radio" name="courseNumber" value="<%=courseNumber%>/<%=sectionNumber%>/${Info.division}/${Info.COGSName}" />
				</label></td>
				<td><c:out value="${Info.COGSName}" /></td>
				<td><c:out value="${Info.division}" /></td>
				<td><c:out value="${Info.startTime}" /></td>
				<td><c:out value="${Info.endTime}" /></td>	
				<td><%=numOfTAsNeeded.get(i) %></td>	
           </tr>
           <%i++;%>
           </c:forEach>
         </table>  
       </div>
    </td>
  </tr>
</table>
				<input type = "hidden" name = "firstname" value = <%=firstname%>>
				<input type = "hidden" name = "lastname" value = <%=lastname%>>	
				<input type="submit"  name = "button" value="Add TA Duties" onclick="return ViewValidation()"/>
				<input type="submit" name = "button" value="View TA Duties" onclick="return ViewValidation()"/>	
</form>
</div>
	</div>
		<div id="footer">
			&copy;UBC Electrical and Computer Engineering. Styled with <a
				href="http://metroui.org.ua">Metro UI CSS</a>
		</div>
</div>
</body>
</html>